package models

import (
	"gorm.io/gorm"
	"time"
)

type Examine struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	UserId    uint           `gorm:"column:user_id;type:bigint(20);comment:用户ID;not null;" json:"user_id"`                                                // 用户ID
	VideoId   uint           `gorm:"column:video_id;type:bigint(20);comment:视频ID;not null;" json:"video_id"`                                              // 视频ID
	Status    uint           `gorm:"column:status;type:int(10) UNSIGNED;comment:审核状态：1:待审核，2:审核成功，3:审核失败;not null;default:1;" json:"status"` // 审核状态：1:待审核，2:审核成功，3:审核失败
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (e *Examine) TableName() string {
	return "examine"
}
func (e *Examine) AddExamine(db *gorm.DB) error {
	return db.Create(&e).Error
}
